load("//tools:defaults.bzl", "jasmine_node_test", "spec_bundle", "ts_library")

package(default_visibility = ["//visibility:public"])

ts_library(
    name = "migration-utilities",
    srcs = glob(
        ["**/*.ts"],
        exclude = ["**/*.spec.ts"],
    ),
    deps = [
        "@npm//typescript",
    ],
)

ts_library(
    name = "unit_tests_lib",
    testonly = True,
    srcs = glob(["**/*.spec.ts"] + ["rules/components/test-setup-helper.ts"]),
    deps = [
        ":migration-utilities",
        "@npm//@types/jasmine",
        "@npm//typescript",
    ],
)

spec_bundle(
    name = "unit_tests_bundle",
    platform = "cjs-legacy",
    deps = [":unit_tests_lib"],
)

jasmine_node_test(
    name = "unit_tests",
    deps = [":unit_tests_bundle"],
)
